package com.firefightingiot.firefightingiot.web.web;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.firefightingiot.firefightingiot.common.base.BaseController;
import com.firefightingiot.firefightingiot.config.dahua.DaHua;
import com.firefightingiot.firefightingiot.config.rocketmq.UserProducer;
import com.firefightingiot.firefightingiot.support.annotaion.Action;
import com.firefightingiot.firefightingiot.support.annotaion.At;
import com.firefightingiot.firefightingiot.support.model.RespEntity;
import com.firefightingiot.firefightingiot.web.service.DeviceService;
import com.firefightingiot.firefightingiot.web.service.UpdateOrgIdService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
/**
 * 消防物联网设备控制器
 */
@Action
@RequestMapping(value="device")
public class DeviceController extends BaseController {
    @Resource
    public DeviceService deviceService;
    @Resource
    private UpdateOrgIdService updateOrgIdService;
    @Resource
    UserProducer userProducer;
    @Resource
    DaHua dahua;

    /**
     * 设备添加
     * @param
     * @return
     */
    @At(value = "typeAdd", method = RequestMethod.POST, param = { "deviceClassify"})
    public RespEntity typeAdd(@RequestBody(required = false) JSONObject jsonParam) throws Exception {
        return deviceService.typeAdd(jsonParam);
    }

    /**
     * 设备修改
     * @param
     * @return
     */
    @At(value = "typeUpdate", method = RequestMethod.POST, param = { "deviceClassify"})
    public RespEntity typeUpdate(@RequestBody(required = false) JSONObject jsonParam) throws Exception {
        return deviceService.typeUpdate(jsonParam);
    }

    /**
     * 设备删除
     * @param
     * @return
     */
    @At(value = "typeDelete", method = RequestMethod.POST, param = { "deviceClassify"})
    public RespEntity typeDelete(@RequestBody(required = false) JSONObject jsonParam) throws Exception {
        return deviceService.typeDelete(jsonParam);
    }

    /**
     * 设备类型列表
     * @param
     * @return
     */
    @At(value = "deviceTypeList", method = RequestMethod.GET, param = { "type"})
    public RespEntity deviceTypeList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceTypeList(jsonParam);
    }

    /**
     * 单位下的摄像头列表
     * @param
     * @return
     */
    @At(value = "deviceCameraList", method = RequestMethod.GET)
    public RespEntity deviceCameraList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceCameraList(jsonParam);
    }
    /**
     * 查询单位下的led,ip音柱，鹰眼e通设备列表
     * @param
     * @return
     */
    @At(value = "deviceList", method = RequestMethod.GET)
    public RespEntity deviceList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceList(jsonParam);
    }
    /**
     * 查询单位下的led,ip音柱，鹰眼e通设备列表（new）
     * @param
     * @return
     */
    //@At(value = "deviceListNew", method = RequestMethod.POST)
    @RequestMapping(value = "deviceListNew", method = RequestMethod.POST)
    public RespEntity deviceListNew(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceListNew(jsonParam);
    }
    /**
     * 设备列表
     * @param
     * @return
     */
    @At(value = "deviceListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity deviceListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceListPage(jsonParam);
    }

    /**
     * 设备详情
     * @param
     * @return
     */
    @At(value = "detail", method = RequestMethod.GET, param = { "id","deviceClassify"})
    public RespEntity detail(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.detail(jsonParam);
    }
    /**
     * 设备详情(不带token)
     * @param
     * @return
     */
    @At(value = "deviceDetail", method = RequestMethod.GET, param = { "id","deviceClassify"})
    public RespEntity deviceDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceDetail(jsonParam);
    }
    /**
     * 设备正常数据保存
     * @param
     * number    设备编号	是
     * time	发出时间，如：2020-05-15 15:00:00	是
     * paraminfo	这里是一个大的json,需要解析	是
     * @return
     */
    @At(value = "normalDataLogAdd", method = RequestMethod.POST, param = { "number","time","paraminfo"})
    public RespEntity normalDataLogAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.normalDataLogAdd(jsonParam);
    }

    /**
     * 今日每个时刻的报警数目统计
     * @param
     * @return
     */
    @At(value = "todayNormalDataLogNumByMin", method = RequestMethod.GET, param = { "deviceClassify"})
    public RespEntity todayNormalDataLogNumByMin(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.todayNormalDataLogNumByMin(jsonParam);
    }

    /**
     * 设备正常数据查询
     * @param
     * deviceClassify    设备分类:1 电气火灾 2 消防用水 3 烟感 4 可燃气体 5 火灾自动联网 6 消防可视化
     * deviceId	设备id
     * time	设备发送时间
     * tabflag	"电气火灾时：
     * 所属tab:1 基本电参数 2 电力检测参数 3 其他参数；其他物联网：前端都传1
     * id 电气火灾--其他参数里筛选不同列表项的数据用
     * @return
     */
    @At(value = "normalDataLogList", method = RequestMethod.POST)
    public RespEntity normalDataLogList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.normalDataLogList(jsonParam);
    }

    /**
     * 电气火灾其他参数列表
     * @param
     * @return
     */
    @At(value = "eleNormalOtherList", method = RequestMethod.GET)
    public RespEntity eleNormalOtherList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.eleNormalOtherList(jsonParam);
    }

    /**
     * 更改设备的离线状态
     * @param
     * @return
     */
    @At(value = "offDeviceListUpdate", method = RequestMethod.POST)
    public RespEntity offDeviceListUpdate(@RequestBody(required = false) JSONArray jSONArray) {
        return RespEntity.success();
//        return deviceService.offDeviceListUpdate(jSONArray);
    }

    /**
     * 单位评估调用接口
     * 查询是否接入设备
     * @param jsonParam
     * @return
     */
    @At(value = "getDeviceCount", method = RequestMethod.GET)
    public Integer getDeviceCount(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getDeviceCount(jsonParam);
    }

    /**
     * 单位名称修改时调用接口
     * 修改设备表和报警日志表的单位名称接口
     * @param jsonParam
     * @return
     */
    @At(value = "updateBusinessName", method = RequestMethod.POST)
    public RespEntity updateDeviceBusinessName(@RequestBody(required = false) JSONObject jsonParam) {
        deviceService.updateBusinessName(jsonParam);
//        jsonParam.put("deviceFlag","updateDeviceBusinessName");
//        String mqFlag = FirefightingiotKit.getStr("mqFlag","mq");
//        if(mqFlag.equals("1")){
//
//        }else if(mqFlag.equals("3")){
//            userProducer.produder(jsonParam.toString());
//        }
        return RespEntity.success();
    }

    /**
     * 产品列表
     * @param jsonParam
     * @return
     */
    @At(value = "productList", method = RequestMethod.GET, param = { "type" })
    public RespEntity productList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.productList(jsonParam);
    }

    /**
     * 查询rtmp
     * @param jsonParam
     * @return
     */
    @At(value = "getRtmp", method = RequestMethod.GET, param = { "number"})
    public RespEntity getRtmp(@RequestBody(required = false) JSONObject jsonParam) throws UnsupportedEncodingException {
        return deviceService.getRtmp(jsonParam);
    }

    /**
     * 查询海康控梯Rtsp
     * @param jsonParam
     * @return
     */
    @At(value = "getHKRtsp", method = RequestMethod.GET, param = { "number"})
    public RespEntity getHKRtsp(@RequestBody(required = false) JSONObject jsonParam)  {
        return deviceService.getHKRtsp(jsonParam);
    }
    /**
     * 查询海康控梯Rtmp
     * @param jsonParam
     * @return
     */
    @At(value = "getHKRtmp", method = RequestMethod.GET, param = { "number"})
    public RespEntity getHKRtmp(@RequestBody(required = false) JSONObject jsonParam)  {
        return deviceService.getHKRtmp(jsonParam);
    }
    /**
     * 查询海康控梯的语音流TalkRtsp
     * @param jsonParam
     * @return
     */
    @At(value = "getHKTalkRtsp", method = RequestMethod.GET, param = { "number"})
    public RespEntity getHKTalkRtsp(@RequestBody(required = false) JSONObject jsonParam)  {
        return deviceService.getHKTalkRtsp(jsonParam);
    }

    /**
     * 查询海康控梯的录像回放rtsp
     * @param jsonParam
     * @return
     */
    @At(value = "getHKPlayBackRtsp", method = RequestMethod.GET, param = { "number"})
    public RespEntity getHKPlayBackRtsp(@RequestBody(required = false) JSONObject jsonParam)  {
        return deviceService.getHKPlayBackRtsp(jsonParam);
    }

    /**
     * 查询海康控梯的录像回放rtmp
     * @param jsonParam
     * @return
     */
    @At(value = "getHKPlayBackRtmp", method = RequestMethod.GET, param = { "number"})
    public RespEntity getHKPlayBackRtmp(@RequestBody(required = false) JSONObject jsonParam)  {
        return deviceService.getHKPlayBackRtmp(jsonParam);
    }

    /**
     * 设备绑定openid
     * @param jsonParam
     * @return
     */
    @At(value = "deviceWechat", method = RequestMethod.POST, param = { "number","openid" })
    public RespEntity deviceWechat(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceWechat(jsonParam);
    }

    /**
     * 烟感设备绑定祥云设备id
     * @param jsonParam
     * @return
     */
    @At(value = "termIdUpdate", method = RequestMethod.POST, param = { "number","termId" })
    public RespEntity termIdUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.termIdUpdate(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 更新派安烟感网关设备状态
     * @Date Created in 10:22 2021/10/29
     * @Param [jsonParam]
     */

    @At(value = "updateGatewaysSmokeState", method = RequestMethod.POST, param = {"number"})
    public RespEntity updateGatewaysSmokeState(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.updateGatewaysSmokeState(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 更新海康梯控摄像头（门禁参数）
     * @Date Created in 17:08 2021/12/7
     * @Param [jsonParam]
     */

    @At(value = "updateHKCamera", method = RequestMethod.POST, param = {"number"})
    public RespEntity updateHKCamera(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.updateHKCamera(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 海康梯控远程关门
     * @Date Created in 10:04 2021/12/8
     * @Param [jsonParam]
     */

    @At(value = "remoteClosing", method = RequestMethod.POST, param = {"deviceIndexCode","channelIndexCode"})
    public RespEntity remoteClosing(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.remoteClosing(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 卸油证据链分页查询
     * @Date Created in 14:07 2021/11/22
     * @Param [jsonParam]
     */

    @At(value = "getChainOfEvidencePageList", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity getChainOfEvidencePageList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getChainOfEvidencePageList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 空开下发指令
     * @Date Created in 11:11 2021/12/1
     * @Param [jsonParam]
     */

    @At(value = "openIssued", method = RequestMethod.POST, param = { "number","type" })
    public RespEntity openIssued(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.openIssued(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 更新空开设备分闸状态
     * @Date Created in 15:45 2021/12/1
     * @Param [jsonParam]
     */

    @At(value = "updateOpeningState", method = RequestMethod.POST, param = { "number","openingState" })
    public RespEntity updateOpeningState(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.updateOpeningState(jsonParam);
    }
    /**
     * 消防物联网系统列表
     * @param jsonParam
     * @return
     */
    @At(value = "getIotSystemList", method = RequestMethod.GET)
    public RespEntity getIotSystemList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getIotSystemList();
    }
    /**
     * @Author YangYu
     * @Description 获取大华云睿token
     * @Date Created in 14:29 2022/1/21
     * @Param [jsonParam]
     */

    @At(value = "getDaHuaYunRuiToken", method = RequestMethod.GET)
    public String getDaHuaYunRuiToken(@RequestBody(required = false) JSONObject jsonParam) throws ParseException {
        return dahua.getDaHuaYunRuiToken();
    }
    /**
     * @Author YangYu
     * @Description 检索用户传输装置一分钟内没报警更新设备在线状态
     * @Date Created in 10:27 2022/2/8
     * @Param []
     */
    @At(value = "updateToHEX100", method = RequestMethod.POST)
    public RespEntity updateToHEX100() {
        return deviceService.updateToHEX100();
    }

    @At(value = "getDeviceNormalLogAll1", method = RequestMethod.POST)
    public RespEntity getDeviceNormalLogAll1(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getDeviceNormalLogAll1(jsonParam);
    }

    @At(value = "getDeviceNormalLogAll2", method = RequestMethod.POST)
    public RespEntity getDeviceNormalLogAll2(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getDeviceNormalLogAll2(jsonParam);
    }


    //批量修改orginId
    @At(value = "updateOrgId", method = RequestMethod.POST)
    public RespEntity updateOrgId(@RequestBody(required = false) JSONObject jsonParam) {
        return updateOrgIdService.updateOrgId(jsonParam);
    }
    //修改离线设备状态
    @At(value = "updateToOff", method = RequestMethod.POST)
    public RespEntity updateToOff(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.updateToOff(jsonParam);
    }

    //更新物联网卡号
    @At(value = "updateIotNumber", method = RequestMethod.POST)
    public RespEntity updateIotNumber(@RequestBody(required = false) JSONObject jsonParam) {
        return updateOrgIdService.updateIotNumber(jsonParam);
    }
    //修改水泵故障指示灯、手自动
    @At(value = "updateWaterPumpInfo", method = RequestMethod.POST)
    public RespEntity updateWaterPumpInfo(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.updateWaterPumpInfo(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 设备接入统计（根据系统类型统计）
     * @Date Created in 14:03 2022/5/24
     * @Param [jsonParam]
     */

    @At(value = "deviceCount", method = RequestMethod.GET)
    public RespEntity deviceCount(@RequestBody(required = false) JSONObject jsonParam) throws ParseException {
        return deviceService.deviceCount(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 根据单位获取明厨亮灶设备列表
     * @Date Created in 14:03 2022/5/24
     * @Param [jsonParam]
     */

    @At(value = "getBrightKitchenDevice", method = RequestMethod.GET)
    public RespEntity getBrightKitchenDevice(@RequestBody(required = false) JSONObject jsonParam) throws ParseException {
        return deviceService.getBrightKitchenDevice(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 根据机构获取明厨亮灶设备列表
     * @Date Created in 14:03 2022/5/24
     * @Param [jsonParam]
     */

    @At(value = "getOrgBrightKitchenDevice", method = RequestMethod.GET)
    public RespEntity getOrgBrightKitchenDevice(@RequestBody(required = false) JSONObject jsonParam) throws ParseException {
        return deviceService.getOrgBrightKitchenDevice(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 加油站通道新增、编辑
     * @Date Created in 14:03 2022/5/24
     * @Param [jsonParam]
     */

    @At(value = "deviceChannelAddOrUpdate", method = RequestMethod.POST)
    public RespEntity deviceChannelAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceChannelAddOrUpdate(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 加油站通道删除
     * @Date Created in 14:03 2022/5/24
     * @Param [jsonParam]
     */

    @At(value = "deviceChannelDel", method = RequestMethod.POST)
    public RespEntity deviceChannelDel(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceChannelDel(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 加油站通道列表
     * @Date Created in 14:03 2022/5/24
     * @Param [jsonParam]
     */

    @At(value = "deviceChannelList", method = RequestMethod.GET)
    public RespEntity deviceChannelList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceChannelList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 设备与监控新增、编辑绑定
     * @Date Created in 14:03 2022/5/24
     * @Param [jsonParam]
     */

    @At(value = "deviceCameraBindingAddOrUpdate", method = RequestMethod.POST)
    public RespEntity deviceCameraBindingAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceCameraBindingAddOrUpdate(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 删除
     * @Date Created in 14:03 2022/5/24
     * @Param [jsonParam]
     */

    @At(value = "deviceCameraBindingDel", method = RequestMethod.POST)
    public RespEntity deviceCameraBindingDel(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceCameraBindingDel(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 设备与监控绑定列表
     * @Date Created in 14:03 2022/5/24
     * @Param [jsonParam]
     */

    @At(value = "deviceCameraBindingList", method = RequestMethod.GET)
    public RespEntity deviceCameraBindingList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.deviceCameraBindingList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 电信AEP盛善电设备下发指令
     * @Date Created in 10:19 2023/2/17
     * @Param [jsonParam]
     */

    @At(value = "createCommand", method = RequestMethod.POST)
    public RespEntity createCommand(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.createCommand(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 电能数据(单个设备查询)
     * @Date Created in 15:50 2023/3/2
     * @Param [jsonParam]
     */

    @At(value = "electricEnergyList", method = RequestMethod.GET,param = { "number","startTime","endTime"})
    public RespEntity electricEnergyList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.electricEnergyList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 电正常数据详情
     * @Date Created in 15:50 2023/3/2
     * @Param [jsonParam]
     */

    @At(value = "getElectricDataDetails", method = RequestMethod.GET)
    public RespEntity getElectricDataDetails(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getElectricDataDetails(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 获取视频流
     * @Date Created in 9:57 2023/3/6
     * @Param [jsonParam]
     */

    @At(value = "getVideoStream", method = RequestMethod.GET, param = { "number"})
    public RespEntity getVideoStream(@RequestBody(required = false) JSONObject jsonParam)  {
        return deviceService.getVideoStream(jsonParam);
    }


    /**
     * @Author YangYu
     * @Description 关闭视频流
     * @Date Created in 9:57 2023/3/6
     * @Param [jsonParam]
     */

    @At(value = "closeVideoStream", method = RequestMethod.GET, param = { "number"})
    public RespEntity closeVideoStream(@RequestBody(required = false) JSONObject jsonParam)  {
        return deviceService.closeVideoStream(jsonParam);
    }


    /**
     * @Author YangYu
     * @Description 小程序、APP统计模块
     * @Date Created in 14:50 2023/3/2
     * @Param [jsonParam]
     */
    @At(value = "getDeviceCountApp", method = RequestMethod.GET)
    public RespEntity getDeviceCountApp(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getDeviceCountApp(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 新增、编辑子设备
     * @Date Created in 14:01 2023/5/11
     * @Param [jsonParam]
     */

    @At(value = "deviceChildrenAddOrUpdate", method = RequestMethod.POST)
    public RespEntity deviceChildrenAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) throws Exception {
        return deviceService.deviceChildrenAddOrUpdate(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 删除子设备
     * @Date Created in 14:03 2023/5/11
     * @Param [jsonParam]
     */

    @At(value = "deviceChildrenDel", method = RequestMethod.POST, param = { "id"})
    public RespEntity deviceChildrenDel(@RequestBody(required = false) JSONObject jsonParam) throws Exception {
        return deviceService.deviceChildrenDel(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 获取水柱箱体数据
     * @Date Created in 13:58 2023/7/11
     * @Param [jsonParam]
     */


    @At(value = "getWaterColumnBoxData", method = RequestMethod.GET, param = { "number"})
    public RespEntity getWaterColumnBoxData(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getWaterColumnBoxData(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 水柱箱体历史数据
     * @Date Created in 15:50 2023/3/2
     * @Param [jsonParam]
     */

    @At(value = "waterColumnBoxDataLogList", method = RequestMethod.GET,param = { "page","limit","number","startTime","endTime"})
    public RespEntity waterColumnBoxDataLogList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.waterColumnBoxDataLogList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 水柱箱体下发指令
     * @Date Created in 14:03 2023/5/11
     * @Param [jsonParam]
     */

    @At(value = "setWaterColumnBoxData", method = RequestMethod.POST, param = { "number","instructions"})
    public RespEntity setWaterColumnBoxData(@RequestBody(required = false) JSONObject jsonParam) throws Exception {
        return deviceService.setWaterColumnBoxData(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description sos通讯录新增、编辑
     * @Date Created in 11:19 2023/7/31
     * @Param [jsonParam]
     */

    @At(value = "addOrUpdateBook", method = RequestMethod.POST, param = { "number"})
    public RespEntity addOrUpdateBook(@RequestBody(required = false) JSONObject jsonParam) throws Exception {
        return deviceService.addOrUpdateBook(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description sos通讯录列表
     * @Date Created in 14:18 2023/7/31
     * @Param [jsonParam]
     */

    @At(value = "sosAddressBookList", method = RequestMethod.GET,param = { "number","type"})
    public RespEntity sosAddressBookList(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.sosAddressBookList(jsonParam);
    }


    /**
     * @Author YangYu
     * @Description 设置视频设备播放时间
     * @Date Created in 11:09 2023/12/19
     * @Param [jsonParam]
     */

    @At(value = "setVideoPlayTime", method = RequestMethod.POST, param = { "number","playTime"})
    public RespEntity setVideoPlayTime(@RequestBody(required = false) JSONObject jsonParam){
        return deviceService.setVideoPlayTime(jsonParam);
    }


    /**
     * @Author YangYu
     * @Description 获取视频设备播放时间
     * @Date Created in 11:37 2023/12/19
     * @Param [jsonParam]
     */

    @At(value = "getVideoPlayTime", method = RequestMethod.GET,param = { "number"})
    public RespEntity getVideoPlayTime(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getVideoPlayTime(jsonParam);
    }


    /**
     * @Author YangYu
     * @Description  更新视频设备播放时间
     * @Date Created in 14:04 2023/12/19
     * @Param [jsonParam]
     */

    @At(value = "updateVideoPlayTime", method = RequestMethod.POST, param = { "number","startTime","endTime"})
    public RespEntity updateVideoPlayTime(@RequestBody(required = false) JSONObject jsonParam) throws ParseException {
        return deviceService.updateVideoPlayTime(jsonParam);
    }


    /**
     * @Author YangYu
     * @Description 手动更新设备状态
     * @Date Created in 10:23 2024/1/10
     * @Param [jsonParam]
     */

    @At(value = "updateDeviceState", method = RequestMethod.POST, param = { "number","state"})
    public RespEntity updateDeviceState(@RequestBody(required = false) JSONObject jsonParam){
        return deviceService.updateDeviceState(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 获取气体灭火系统数据
     * @Date Created in 11:20 2024/4/3
     * @Param [jsonParam]
     */

    @At(value = "getGasFireExtinguishingData", method = RequestMethod.GET,param = { "number"})
    public RespEntity getGasFireExtinguishingData(@RequestBody(required = false) JSONObject jsonParam) {
        return deviceService.getGasFireExtinguishingData(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 物联网设备下发指令
     * @Date Created in 15:53 2024/12/17
     * @Param [jsonParam]
     */

    @At(value = "iotPost", method = RequestMethod.POST, param = { "id","state"})
    public RespEntity iotPost(@RequestBody(required = false) JSONObject jsonParam){
        return deviceService.iotPost(jsonParam);
    }

}
